package org.firebug.spring.boot.controller;

import org.firebug.common.bean.api.Response;
import org.firebug.spring.boot.mq.RabbitmqProducer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = {"/rabbit"})
public class RabbitController {
    @Resource
    private RabbitmqProducer rabbitmqProducer;

    @RequestMapping(value = "/send", method = RequestMethod.GET)
    public Response send(String exchange, String routingKey, String content) {
        rabbitmqProducer.send(exchange, routingKey, content);
        return Response._200;
    }
}
